package com.caesar.Practice_enum;

/**
 * @author caesar
 * @date 2025/7/11
 * @Description:
 * @apiNote
 */
public enum TrafficLight {
    RED{
        @Override
        public TrafficLight nextState() {
            return YELLOW;
        }
    },
    YELLOW{
        public TrafficLight nextState() {
            return GREEN;
        }
    },
    GREEN{
        public TrafficLight nextState() {
            return RED;
        }
    };

    public abstract TrafficLight nextState();

}
